import { defineComponent } from "vue";
import { ElTable, ElTableColumn, TableColumnCtx } from "element-plus";
export default defineComponent({
  setup() {
    return () => {
      const handleSelectionChange = (val: unknown) => {
        console.log(val);
      };
      const tabelConfig = {
        data: [
          {
            id: "1",
            name: "1",
          },
          {
            id: "2",
            name: "2",
          },
        ],
        onSelectionChange: handleSelectionChange,
      };
      const tableColumnProp: Partial<TableColumnCtx<any>>[] = [
        {
          type: "selection",
          width: 50,
        },
        {
          type: "index",
          label: "序号",
          width: 60,
        },
        {
          prop: "id",
          label: "ID",
          width: 300,
        },
        {
          prop: "name",
          label: "姓名",
          formatter: (row, column, cellValue, index) => {
            return "sssssss";
          },
        },
      ];

      return (
        <div>
          <span>ddd</span>

          <ElTable {...tabelConfig}>
            {tableColumnProp.map((config) => (
              <ElTableColumn {...config}></ElTableColumn>
            ))}
          </ElTable>
        </div>
      );
    };
  },
});
